<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>搜索机构</title>
    <link rel="stylesheet" type="text/css" href="__CSS__api.css"/>
    <link rel="stylesheet" type="text/css" href="__CSS__aui.css"/>
    <style>
        .aui-iconfont {
            position: relative;
            font-family: "aui_iconfont" !important;
            font-size: 0.7rem;
            font-style: normal;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            height: 2.4rem;
        }

        .aui-icon-tu {
            height: 2.4rem;
            width: 49px;
            background: url('__IMG__left.png') no-repeat 0.5rem center;
            background-size: 19px 19px;
        }

        .aui-bar-nav .aui-iconfont1 {
            position: relative;
            z-index: 20;
            font-size: 0.9rem;
            color: #ffffff;
            line-height: 2.4rem;
            padding-left: 0.75rem;
        }

        .aui-searchbar {
            display: -webkit-box;
            -webkit-box-pack: center;
            -webkit-box-align: center;
            height: 2.4rem;
            overflow: hidden;
            width: 98%;
            background-color: #ffffff;
            color: #9e9e9e;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }

        .aui-searchbar-input {
            margin-right: 2.5rem;
            background-color: #F5F7F8;
            border-radius: 1rem;
            height: 30px;
            line-height: 30px;
            font-size: 0.7rem;
            position: relative;
            /*padding-left: 0.0rem;*/
            display: -webkit-box;
            -webkit-box-flex: 1;
            /*padding-right:1.0rem;*/
        }

        .aui-searchbar-input input {
            color: #999999;
            width: 100%;
            padding: 0;
            margin: 0;
            height: 1.5rem;
            line-height: normal;
            border: 0;
            -webkit-appearance: none;
            font-size: 0.7rem;
            background-color: #ffffff;
        }

        .aui-searchbar .aui-iconfont {
            line-height: 1.50rem;
            color: #9e9e9e !important;
        }

        .aaa {
            height: 1.6rem;
            line-height: 1.6rem;
            font-size: 0.64rem;
            color: #333333 !important;
            display: inline-block;
            vertical-align: top;
            margin-left: 10px;
        }

        .aui-icon-search:before {
            content: '';
            width: 10px;
            height: 1.50rem;
            background: url('__IMG__xiala.png') no-repeat center center;
            background-size: 10px 10px;
            display: inline-block;
        }

        .aui-bar-nav .aui-title {
            min-height: 2.4rem;
            position: absolute;
            margin: 0;
            text-align: center;
            white-space: nowrap;
            right: 0.75rem;
            left: 1.5rem;
            /* width: auto; */
            overflow: hidden;
            text-overflow: ellipsis;
            z-index: 2;
        }

        .aui-icon-rightu {
            height: 2.4rem;
            width: 49px;
            margin-top: 0.1rem;
            margin-right: 0.2rem;
        }

        .aui-searchbar {
            display: -webkit-box;
            -webkit-box-pack: center;
            -webkit-box-align: center;
            height: 2.4rem;
            overflow: hidden;
            width: 98%;
            background-color: #ffffff;
            color: #9e9e9e;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }

        .aui-searchbar-input {
            margin-right: 2.5rem;
            background-color: #F5F7F8;
            border-radius: 1rem;
            height: 30px;
            line-height: 30px;
            font-size: 0.7rem;
            position: relative;
            /*padding-left: 0.0rem;*/
            display: -webkit-box;
            -webkit-box-flex: 1;
            /*padding-right:1.0rem;*/
        }

        .aui-searchbar-input input {
            background: none !important;
            color: #999999;
            width: 100%;
            padding: 0;
            margin: 0;
            height: 1.5rem;
            line-height: normal;
            border: 0;
            -webkit-appearance: none;
            font-size: 0.7rem;
            background-color: #ffffff;
        }

        .aui-searchbar .aui-iconfont {
            line-height: 1.50rem;
            color: #9e9e9e !important;
        }

        .bigout {
            z-index: 0;
        }

        .out {
            background-color: #fff;
            padding: 0.875rem 0.7rem 0.875rem 0.8rem;
            width: 100%;

        }

        .area1 {
            height: 1.2rem;
            color: #282828;
            font-size: 0.7rem;
            line-height: 1.2rem;
            font-weight: bold;
        }

        .delete {
            width: 1rem;
            height: 1rem;

        }

        .delete img {
            width: 100%;
            height: 100%;
        }

        .history {
            font-size: 0.75rem;
            color: #333333;
        }

        .historyWen {
            font-size: 0.75rem;
            color: #666666;
        }

        .xiala {
            display: inline-block;
            vertical-align: text-top;
            width: 0.6rem;
            height: 0.6rem;
            margin-left: 5px;
        }

        .shaa {
            width: 5rem;
            height: 5rem;
            position: absolute;
            z-index: 999;
            left: 2.5rem;
            top: 4rem;
            background-color: #FFFFFF;
            font-size: 0.75rem;
            line-height: 2.5rem;
            text-align: center;
            border-radius: 5px;
            box-shadow: 2.5px 5px 6.5px rgba(246, 246, 246, 1);
            display: none;
        }
    </style>
</head>
<body>
<header class="aui-bar aui-bar-nav underLine" style="padding-top:1.25rem;background-color:#FFFFFF;" id="header">

    <a class="aui-pull-left" tapmode="active" onclick="history.go(-1)"> <span class="aui-iconfont aui-icon-tu"> </span>
    </a>

    <div class="aui-title">
        <div class="aui-searchbar" id="search" style="position:relative">
            <div class="aui-searchbar-input aui-border-radius">
                <div style="">
                    <span class="aaa" id="aaa" onclick="search()">搜机构
                        <img src="__IMG__xiala.png" alt="" class="xiala"></span>
                    <input type="text" name="keyword" style="display: inline-block" placeholder="请输入机构名称">


                </div>

            </div>
        </div>
    </div>
    <a class="aui-pull-right">
        <span class="aui-iconfont aui-icon-rightu" tapmode="active" onclick="right()">搜索</span>
    </a>
    <div class="shaa" id="shaa">
        <div class="underLine" onclick="sousou(this,1)">
            搜活动
        </div>
        <div class="" onclick="sousou(this,2)">
            搜机构

        </div>
    </div>
</header>

<div class="bigout" style="z-index:1;">
    <div class="out" style="padding:0.8rem 0.7rem 0.4rem 0.8rem">
        <div class="area area1 flex-wrap">
            <div class="flex-con history">历史搜索</div>
            <div class="delete" id="delete" onclick="deleteHistory()">
                <img src="__IMG__delet@3x.png" alt="">
            </div>
        </div>
    </div>

    <div class="out underLine">
        {volist name="list" id="vo"}
        <div class="flex-wrap">
            <div class="flex-con historyWen" onclick="bbb(this)" idd="{$vo.search_content}">{$vo.search_content}</div>
            <div class="delete">
                <img src="__IMG__cha1@3x.png" onclick="deleteHistoryList({$vo.search_id})">
            </div>
        </div>
        {/volist}
    </div>

</div>

</body>
<script type="text/javascript" src="__JS__api.js"></script>
<script type="text/javascript" src="__JS__tt.js"></script>
<script type="text/javascript" src="__JS__swiper.min.js"></script>
<script type="text/javascript" src="__JS__layer_mobile/layer.js"></script>
<script type="text/javascript" src="__JS__jquery.min.js"></script>

<script type="text/javascript">
    var shu = 0;
    var leixing = "活动"
    function right() {
        var keyword = $('input[name="keyword"]').val();
        location.href = '{:url("First/mechanism")}?type=2&keyword=' + keyword;
    }
    function search() {
        if (shu == 0) {
            document.getElementById('shaa').style.display = "block";
            shu = 1;
        } else {
            document.getElementById('shaa').style.display = "none";
            shu = 0;
        }
    }
    function sousou(el, type) {
        if (type == 2) {
            location.href = '{:url("First/sactivity")}?type=2';
        } else if (type == 1) {
            location.href = '{:url("First/search")}?type=1';
        }

        document.getElementById('aaa').innerText = el.innerText;
        document.getElementById('shaa').style.display = "none";
        shu = 0;
        var patt1 = new RegExp("活动");
        if (patt1.test(el.innerText)) {
            leixing = "活动"
        } else {
            leixing = "机构"
        }

    }
    //清楚所有记录
    function deleteHistory() {
        var clear_length = $(".historyWen").length;
        if (clear_length > 0) {
            $.ajax({
                url: '{:url("First/clear")}',
                data: {type: 2, type_lx: 2},//
                type: 'POST',
                dataType: 'JSON',
                success: function (data) {
                    console.log(data);
                    if (data.status == 200) {
                        layer.open({
                            content: '删除成功'
                            , skin: 'msg'
                            , time: 3 //2秒后自动关闭
                        });
                        window.location.reload();
                    } else if (data.status == 'E001') {
                        layer.open({
                            content: '删除失败'
                            , skin: 'msg'
                            , time: 3 //2秒后自动关闭
                        });
                        window.location.reload();
                    }
                }
            })

        }
    }
    //清除单个记录
    function deleteHistoryList(id) {
        $.ajax({
            url: '{:url("First/clear")}',
            data: {search_id: id, type: 1},
            type: 'POST',
            dataType: 'JSON',
            success: function (data) {
                if (data.status == 200) {
                    layer.open({
                        content: '删除成功'
                        , skin: 'msg'
                        , time: 3 //2秒后自动关闭
                    });
                    window.location.reload();
                } else if (data.status == 'E001') {
                    layer.open({
                        content: '删除失败'
                        , skin: 'msg'
                        , time: 3 //2秒后自动关闭
                    });
                    window.location.reload();
                }
            }
        })
    }
    function bbb(el) {
        var idd = $api.attr(el, 'idd');
        location.href = '{:url("First/mechanism")}?type=2&keyword=' + idd;
    }
</script>

</html>
